package work.comeback.omo.model.movie;

import lombok.Data;
import work.comeback.omo.model.movie.detail.MovieDetail;
import work.comeback.omo.model.movie.info.MovieInfo;
import work.comeback.omo.util.common.TimeUtils;

import java.util.ArrayList;
import java.util.HashSet;

@Data
public class MovieTask {
    private String id;
    private String url;
    private String baseUrl;
    private String moviePrefix;
    private String detailPrefix;
    private int interval;
    private ArrayList<MovieInfo> movieInfo = new ArrayList<>();
    private HashSet<MovieDetail> movieDetail = new HashSet<>();

    public MovieTask(String baseUrl, String moviePrefix) {
        this(baseUrl, moviePrefix, "");
    }

    public MovieTask(String baseUrl, String moviePrefix, String detailPrefix) {
        this();
        setBaseUrl(baseUrl);
        setMoviePrefix(moviePrefix);
        setDetailPrefix(detailPrefix);
        setUrl(baseUrl + moviePrefix);
    }

    public MovieTask() {
        setId(TimeUtils.getRandomTimestamp());
        setInterval(3000);
    }
}